/**
 * 
 */
package de.cbf.cam.dsa.tavern.carte.ui;

import java.util.Iterator;

import org.eclipse.swt.SWT;
import org.eclipse.swt.layout.GridData;
import org.eclipse.swt.widgets.Composite;

import de.cbf.cam.dsa.tavern.carte.model.entities.interfaces.IEditableEntity;
import de.cbf.cam.dsa.tavern.carte.ui.interfaces.ICompositeEditEntity;
import de.cbf.cam.dsa.tavern.carte.ui.interfaces.ICompositeEntities;

/**
 * @author Stefan Alter
 *
 */
public class CompositeEditProcessings extends AbstractCompositeEditEntities {
	private CompositeEditProcessing	compositeEditEntity;
	private CompositeNamedEntities	compositeEntities;
	/**
	 * @param parent
	 * @param style
	 */
	public CompositeEditProcessings(Composite parent, int style) {
		super(parent, style);		
	}

	/* (non-Javadoc)
	 * @see de.cbf.cam.dsa.tavern.carte.ui.interfaces.ICompositeEditEntities#getEntitySelected()
	 */
	@Override
	public IEditableEntity getEntitySelected() {
		return compositeEntities.getSelectedEntity();
	}

	/* (non-Javadoc)
	 * @see de.cbf.cam.dsa.tavern.carte.ui.interfaces.ICompositeEditEntities#setEntitySelected(de.cbf.cam.dsa.tavern.carte.model.entities.interfaces.IEditableEntity)
	 */
	@Override
	public void setEntitySelected(IEditableEntity value) {
		compositeEntities.setSelectedEntity(value);
	}

	/* (non-Javadoc)
	 * @see de.cbf.cam.dsa.tavern.carte.ui.interfaces.ICompositeEditEntities#setEntities(java.util.Iterator)
	 */
	@Override
	public void setEntities(Iterator<IEditableEntity> values) {
		compositeEntities.setEntities(values);
	}

	/* (non-Javadoc)
	 * @see de.cbf.cam.dsa.tavern.carte.ui.AbstractCompositeEditEntities#createCompositeEntities(org.eclipse.swt.widgets.Composite)
	 */
	@Override
	protected ICompositeEntities createCompositeEntities(Composite parent) {
		compositeEntities = new CompositeNamedEntities(parent, SWT.NONE);		
		compositeEntities.setLayoutData(new GridData(GridData.FILL_BOTH));
		return compositeEntities;
	}

	/* (non-Javadoc)
	 * @see de.cbf.cam.dsa.tavern.carte.ui.AbstractCompositeEditEntities#createCompositeEntityEdit(org.eclipse.swt.widgets.Composite)
	 */
	@Override
	protected ICompositeEditEntity createCompositeEntityEdit(Composite parent) {
		compositeEditEntity = new CompositeEditProcessing(parent, SWT.NONE);
		compositeEditEntity.setLayoutData(new GridData(GridData.FILL_BOTH));
		return compositeEditEntity;
	}

	@Override
	public ICompositeEditEntity getCompositeEditEntity() {
		return compositeEditEntity;
	}
	

}
